package com.oktest.measure.db.room

import androidx.room.*
import com.oktest.measure.entity.Device
import com.oktest.measure.entity.Type
import com.oktest.measure.entity.Xml

/**
 * @Author hhh
 * @Date 2020/10/24
 */
@Dao
interface XmlDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(list: List<Xml>)

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(bean:Xml)

    @Query("select * from xml")
    fun queryAll(): List<Xml>

    @Query("select * from device where xmlId=:id")
    fun devices(id:Long): List<Device>

    @Query("select * from xml where id=:id")
    fun load(id: Long): Xml?

    @Update(onConflict = OnConflictStrategy.REPLACE)
    fun update(xml: Xml)
}